package com.wuhainan.beelzebub.entity.system;

import com.wuhainan.beelzebub.common.BaseEntity;
import com.wuhainan.beelzebub.utils.tree.TreeEntity;
import org.hibernate.annotations.Formula;

import javax.persistence.Entity;
import javax.persistence.Transient;
import java.util.List;

/**
 * <br>Created by 吴海南 on 2017-12-18.
 * <br>星期一 at 下午 4:53.
 */
@Entity
public class Menu extends BaseEntity implements TreeEntity<Menu>{
    private String texts;
    private String translate;
    private Boolean groups;
    private String link;
    private String icon;
    private Boolean shortcut;
    private Boolean shortcutRoot;
    private Integer badge;
    private String acl;
    private String parentId;
    private Integer sort;
    private String target;
    private Boolean statuses;
    @Formula("(select m.texts from menu m where m.id = parent_id)")
    private String parentTexts;
    @Transient
    private List<Menu> children;

    public String getTexts() {
        return texts;
    }

    public void setTexts(String texts) {
        this.texts = texts;
    }

    public String getTranslate() {
        return translate;
    }

    public void setTranslate(String translate) {
        this.translate = translate;
    }

    public Boolean getGroups() {
        return groups;
    }

    public void setGroups(Boolean groups) {
        this.groups = groups;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Boolean getShortcut() {
        return shortcut;
    }

    public void setShortcut(Boolean shortcut) {
        this.shortcut = shortcut;
    }

    public Integer getBadge() {
        return badge;
    }

    public void setBadge(Integer badge) {
        this.badge = badge;
    }

    public String getAcl() {
        return acl;
    }

    public void setAcl(String acl) {
        this.acl = acl;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public Boolean getStatuses() {
        return statuses;
    }

    public void setStatuses(Boolean statuses) {
        this.statuses = statuses;
    }

    public List<Menu> getChildren() {
        return children;
    }

    public void setChildren(List<Menu> children) {
        this.children = children;
    }

    public Boolean getShortcutRoot() {
        return shortcutRoot;
    }

    public void setShortcutRoot(Boolean shortcutRoot) {
        this.shortcutRoot = shortcutRoot;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getParentTexts() {
        return parentTexts;
    }

    public void setParentTexts(String parentTexts) {
        this.parentTexts = parentTexts;
    }
}
